package org.example.sulotion;

public class 回文数 {
    public static void main(String[] args) {
        int x=121;
        int x1=123;
        boolean b = isPalindrome(x);
        boolean b1 = isPalindrome(x1);
        System.out.println(b);
        System.out.println(b1);

    }
    public static  boolean isPalindrome(int x) {
        String x1 = String.valueOf(x);
        int len = x1.length();
        for (int i = 0; i <len ; i++) {
            if(x1.charAt(i) == x1.charAt(len-1)){
                len--;
            }else {
                return false;
            }

        }
        return true;
    }
}
